import React from 'react';
import ReactDOM from 'react-dom';
class App extends React.Component {

    render() {
        console.log(this.props)
        return <div className=''>

        </div>;
    }
}
function connect(params={}){
  return function(Com){
    return class Temp  extends React.PureComponent{
      // PureComponent 内部默认调用了shouldComponentUpdate进行优化
      state = {
        name:"珠峰"
      }
      render(){
        console.log(this.props,params)
        return <Com className="box" {...params}  name={this.state.name} {...this.props}/>
      }
    }
  }
}
App = connect({age:10,sex:1})(App)

ReactDOM.render(<App hello="hello"/>,document.getElementById('root'))